﻿<Window x:Class="SuffixTreeView.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:graphsharp="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls"
        xmlns:local="clr-namespace:SuffixTreeView.ViewModel"
        xmlns:win="clr-namespace:SuffixTreeView"
        xmlns:zoom="clr-namespace:WPFExtensions.Controls;assembly=WPFExtensions"
        
        Title="MainWindow" Height="350" Width="725">
    <Window.CommandBindings>
        <CommandBinding Command="win:MainWindow.CreateNewTree" CanExecute="CreateNewTree_CanExecute" Executed="CreateNewTree_Executed" />
    </Window.CommandBindings>
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/GraphResources.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>


        <StackPanel Orientation="Vertical" Grid.Row="0" >
            <StackPanel Orientation="Horizontal" Background="Black"
                        HorizontalAlignment="Stretch" Margin="0">
                <Label VerticalAlignment="Center" VerticalContentAlignment="Center" Foreground="White"
                        FontSize="10" FontFamily="Verdana" FontWeight="Bold" Margin="0,0,0,0"  
                        Content="Pick Layout Type"/>
                <ComboBox ItemsSource="{Binding LayoutAlgorithmTypes}"
                          SelectedItem="{Binding Path=LayoutAlgorithmType, Mode=TwoWay}"
                          Width="150" Height="25" Margin="5" />
                <TextBox Width="200" Height="25" Margin="5" Text="{Binding Text}" />
                <Button Content="Create New Tree" Width="150" Height="25" Margin="5" Command="win:MainWindow.CreateNewTree"/>
            </StackPanel>
        </StackPanel>

        <zoom:ZoomControl  Grid.Row="1"  Zoom="0.2" ZoomBoxOpacity="0.5" Background="#ff656565">

            <local:SuffixTreeGraphLayout x:Name="graphLayout" Margin="10"
						Graph="{Binding Path=Graph}"
						LayoutAlgorithmType="{Binding Path=LayoutAlgorithmType, Mode=OneWay}"
						OverlapRemovalAlgorithmType="FSA"
						HighlightAlgorithmType="Simple" />
        </zoom:ZoomControl>

    </Grid>

</Window>
